package os

import (
	mycmd "svntool/application/models/util/cmd"
	"strings"
	"runtime"
)

func Info() (os string, artiture string, err error){
	os = runtime.GOOS
	artiture = runtime.GOARCH
	if os == "linux" {
		output, err := mycmd.ExecCmd("cat /etc/issue")
		if err != nil {
			return "", artiture, err
		}
		output = strings.Split(output, " ")[0]
		if output == "Ubuntu" {
			os = "ubuntu"
		}else{
			os = "centos"
		}
	}
	return os, artiture, nil
}